package org.idea.qiyu.framework.apm.agent.core.servlet;

import javax.servlet.http.Cookie;
import java.util.Arrays;
import java.util.Map;

/**
 * servlet层的统计对象
 *
 * @Author linhao
 * @Date created in 2:56 下午 2021/7/18
 */
public class ServletStatisticsObject {

    private String traceId;

    private long begin;

    private long end;

    private String url;

    private Cookie[] cookies;

    private Map<String,String[]> params;

    private Map<String,String[]> headers;

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public long getBegin() {
        return begin;
    }

    public void setBegin(long begin) {
        this.begin = begin;
    }

    public long getEnd() {
        return end;
    }

    public void setEnd(long end) {
        this.end = end;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Cookie[] getCookies() {
        return cookies;
    }

    public void setCookies(Cookie[] cookies) {
        this.cookies = cookies;
    }

    public Map<String, String[]> getParams() {
        return params;
    }

    public void setParams(Map<String, String[]> params) {
        this.params = params;
    }

    public Map<String, String[]> getHeaders() {
        return headers;
    }

    public void setHeaders(Map<String, String[]> headers) {
        this.headers = headers;
    }

    @Override
    public String toString() {
        return "ServletStatisticsObject{" +
                "traceId='" + traceId + '\'' +
                ", begin=" + begin +
                ", end=" + end +
                ", url='" + url + '\'' +
                ", cookies=" + Arrays.toString(cookies) +
                ", params=" + params +
                ", headers=" + headers +
                '}';
    }
}
